/*
 * Atoms.h
 *
 *  Created on: May 20, 2011
 *      Author: marchi
 */

#ifndef ATOMS_H_
#define ATOMS_H_
#include "typedefs.h"
#include "Metric.h"
#include "AtomIndex.h"
#include <iostream>

class Atoms {
protected:
	int nr;
	int status;
	rvec * x;
	Metric Mt;
public:
	Atoms(){
		nr=0;
		x=NULL;
	};
	Atoms(const int);
	Atoms(const AtomIndex &);
	Atoms(const Atoms &);
	virtual ~Atoms();

	void setDim(const int n){nr=n;if(x) delete [] x;x=new rvec [nr];}
	void setCoord(const Metric &, const rvec *, const AtomIndex & );
	void setCoord(const Metric &, const rvec *, const int );

	Atoms & operator=(const Atoms &);
	Atoms & operator=(const real);
	rvec & operator[](const int i){return x[i];};
	void Rot(const rvec [DIM]);
	void Tra(const rvec );
	int getNR(){return nr;};
	Metric & getMt(){return Mt;};
	Atoms COtoOC();
	Atoms OCtoCO();
	Atoms Shift(const rvec);
};

#endif /* ATOMS_H_ */

